package com.community.charge.controller;

import com.community.charge.service.BuildingVoService;
import com.community.common.core.controller.BaseController;
import com.community.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/building")
public class BuildingVoController extends BaseController {

    @Autowired
    private BuildingVoService buildingVoService;

    //根据社区绑定楼宇下拉框
    @GetMapping("/getBuildingVoNameAndId/{id}")
    public AjaxResult getBuildingVoNameAndId(@PathVariable Integer id){
        return AjaxResult.success(buildingVoService.getBuildingVoNameAndId(id));
    }

    //绑定楼宇下拉框
    @GetMapping("/getBuildingVoIdAndName")
    public AjaxResult getBuildingVoIdAndName(){
        return AjaxResult.success(buildingVoService.getBuildingVoIdAndName());
    }

}
